Repository navigation
Conversation
For the layer straddling depth_runoff_Nloss, the included fraction
(D - z_{j-1})/dz was cancelled by dividing by (D - z_{j-1}), so the layer
lost NO3 as if fully inside the mixing zone. Divide by the full layer
thickness instead, consistent with surface_water.
Fixes ESCOMP#4353
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Quicktest results (SBGC-001)Will ran this fix in an 80 year test against an unmodified baseline (case
Below is Claude's summary of the results for this PR.
Expected: Lower NO3 runoff, since only the mixing-zone fraction of the layer straddling depth_runoff_Nloss now contributes. Found: NO3 runoff falls −6.3% (5.09 → 4.78 TgN/yr), consistently across regions (about 4–13% lower in each region we looked at). Soil mineral N changes by only +0.1%. A small N-loss diagnostic and flux correction; no effect on vegetation or the land energy and water budget.
Key figures
Setup80-year land-only runs: Analysis scripts: |
pSASU spin-up results (SBGC-001)Follow-up to the quicktest results above. Will also ran this fix through a full cold-start spin-up (AD → SASU → pSASU; case
Below is Claude's summary of the results for this PR.
Found: NO3 runoff falls 6.0% (4.93 → 4.63 TgN/yr; quicktest −6.3%), by 4–13% in every region we looked at. After the spin-up, ecosystem C in the combined run is 3.34 PgC higher, several times the spin-up noise floor (see Setup below); keeping more N in the soil is a plausible pathway for that. A small N-loss correction with a small, plausible carbon consequence at equilibrium; no effect on the land energy or water budget.
Key figures
SetupEach case is a cold-start spin-up with its fix in place: Analysis scripts: |
Implications (SBGC-001)Short summary of what the full cold-start spin-up (AD → SASU → pSASU, f19 BGC-Crop, 1850) means for this fix. SBGC-001 (NO3 runoff in the partially-included layer is not scaled by the fraction inside the 5 cm mixing depth): No climate signal. Tested in the audit-easy bundle. NO3 runoff falls 6.0% (4–13% in every region). Ecosystem C in the bundle is 3.3 PgC higher, several times the spin-up noise floor, and this fix keeping more N in the soil is the plausible pathway. Merge as is. Details: full pSASU results above Prepared with AI assistance (Claude) from the pSASU analysis in |
Test resultsBranch Offline check of the mixing-zone identityI recomputed the nitrification–denitrification surface-runoff loop for master and for this PR, using every active soil and crop column of a spun-up restart.
The check is Σ_j
On master, the layer that straddles 0.05 m gets a full water weight instead of its fraction above the mixing depth. As a result, NO3 runoff is overstated by up to a third. With this PR the identity holds to round-off. System testsI used the f10 grid from the current test list (
These were run on the branch only, without a baseline comparison. Not run
Tests set up and run, and this summary written, with AI assistance (Claude Code). |
|
Tests pass and changes in NO3 runoff are relatively small (6%), as expected. I think this PR is ready for review |


This PR makes NO3 runoff calculations consistent with surface water runoff calculations.
Description of changes
In
SoilBiogeochemNLeaching, NO3 runoff loss from the soil layer that straddlesdepth_runoff_Nloss(5 cm) was calculated as if the whole layer were inside the mixing zone. The included fraction f = (D − z_{j−1})/dz was multiplied in and then cancelled by dividing by (D − z_{j−1}).surface_water, by contrast, counts only fraction f of that layer's water. On the default 20SL_8.5m grid (layer 2 spans 0.02–0.06 m, f = 0.75), total NO3 runoff loss is about 20% too high. The formula has been unchanged since clm4_0_60 (2013). Details and history are in #4353.This PR changes only
src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90: the straddling-layer flux now divides by the full layer thicknesscol%dz(c,j)instead of(depth_runoff_Nloss − zisoi(j−1)). The layer then losessf_no3·NO3·f·q_surf/W_mixper unit volume, consistent withsurface_water, and the water-weight shares across layers sum to 1.Status: tested; see the test results.
Specific notes
Contributors other than yourself, if any:
CTSM issues resolved or otherwise addressed, if any:
If answers are expected to change, describe (delete this line otherwise):
use_nitrif_denitrif(the default) that have surface runoff.SMIN_NO3_RUNOFFshould decrease by about 15–20%. Because runoff N leaves the column, soil mineral N and downstream N cycling change slightly as well. This is not a diagnostic-only change.Any user interface changes (namelist or namelist defaults changes)?
Testing planned or performed, if any:
ERP_D_Ld5.f10_f10_mg37.I1850Clm60BgcCrop.derecho_intel.clm-nvmovement--clm-matrixcnOnERI_C2_Ld9.f10_f10_mg37.I2000Clm60BgcCrop.derecho_intel.clm-defaultsmin_no3_runoff_vr·dz_j equals the mixing-zone NO3 concentration timesqflx_surfQuestions for reviewers
zisoitogether with the column'scol%dz. These match on the standard grids but may not on non-default soil structures. Should that be addressed here or separately?